Adwaita: Don't do n-th child things for list rows
authorMatthias Clasen <mclasen@redhat.com>
Wed, 11 Nov 2020 18:07:31 +0000 (13:07 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 11 Nov 2020 18:18:08 +0000 (13:18 -0500)
Making the list row child css depend on the position
is very expensive, and does not acutally work correctly
(since we don't have widgets for all children, so the
position of the child widget does not reflect the actual
model item position).

To make this more palatable, use the bottom border
instead of the top border, since most lists have a natural
border at the top (with headers), and may end up with
empty space at the bottom.

gtk/theme/Adwaita/_common.scss

index a552965cdd1a3cd82e516cd7c290fdf4a33a5d19..8b5c53bdec834119668c62e54fabc76721675b40 100644 (file)
@@ -3098,13 +3098,13 @@ list {
   > row.expander { padding: 0px; }
   > row.expander .row-header { padding: 2px; }
 
-  &.horizontal row.separator:not(:first-child),
-  &.separators.horizontal > row:not(:first-child) {
+  &.horizontal row.separator,
+  &.separators.horizontal > row {
     border-left: 1px solid $_treeview_borders_color;
   }
-  &:not(.horizontal) row.separator:not(:first-child),
-  &.separators:not(.horizontal) > row:not(:first-child) {
-    border-top: 1px solid $_treeview_borders_color;
+  &:not(.horizontal) row.separator,
+  &.separators:not(.horizontal) > row {
+    border-bottom: 1px solid $_treeview_borders_color;
   }
 }